package com.sc.nft.controller;

import com.sc.nft.annotation.UserLogin;
import com.sc.nft.controller.request.AppPackageMangeNameRequest;
import com.sc.nft.entity.vo.AppPackageManageGetByNameVO;
import com.sc.nft.entity.vo.WebApplicationRequirementVO;
import com.sc.nft.service.AppPackageManageService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


/**
 * (AppPackageMange)表控制层
 *
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/appPackageManage")
@Api(tags = "前台校验应用包更新")
public class AppPackageMangeController {
    /**
     * 服务对象
     */
    private final AppPackageManageService appPackageManageService;
    @ApiOperation(value = "前台校验应用包更新", notes = "前台校验应用包更新", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/get", produces = MediaType.APPLICATION_JSON_VALUE)
    @UserLogin
    public Result<AppPackageManageGetByNameVO> webApplicationRequirement(@RequestBody AppPackageMangeNameRequest AppPackageMangeNameRequest) {
        return Result.success(appPackageManageService.getByName(AppPackageMangeNameRequest.getSourcePackageName()));
    }
   
}
